package com.sophossystems.client.asmon.dto;


import java.io.Serializable;


public class ModuleDTO implements Serializable
{
	/**
	 * 
	 */
	private static final long serialVersionUID = -7669927819316257478L;

	/** 
	 * This attribute maps to the column idModule in the Module table.
	 */
	protected int idModule;

	/** 
	 * This attribute maps to the column Description in the Module table.
	 */
	protected String description;

	/** 
	 * This attribute maps to the column idSystem in the Module table.
	 */
	protected int idSystem;

	/** 
	 * This attribute represents whether the primitive attribute idSystem is null.
	 */
	protected boolean idSystemNull = true;

	/**
	 * Method 'Module'
	 * 
	 */
	public ModuleDTO()
	{
	}

	/**
	 * Method 'getIdModule'
	 * 
	 * @return int
	 */
	public int getIdModule()
	{
		return idModule;
	}

	/**
	 * Method 'setIdModule'
	 * 
	 * @param idModule
	 */
	public void setIdModule(int idModule)
	{
		this.idModule = idModule;
	}

	/**
	 * Method 'getDescription'
	 * 
	 * @return String
	 */
	public String getDescription()
	{
		return description;
	}

	/**
	 * Method 'setDescription'
	 * 
	 * @param description
	 */
	public void setDescription(String description)
	{
		this.description = description;
	}

	/**
	 * Method 'getIdSystem'
	 * 
	 * @return int
	 */
	public int getIdSystem()
	{
		return idSystem;
	}

	/**
	 * Method 'setIdSystem'
	 * 
	 * @param idSystem
	 */
	public void setIdSystem(int idSystem)
	{
		this.idSystem = idSystem;
		this.idSystemNull = false;
	}

	/**
	 * Method 'setIdSystemNull'
	 * 
	 * @param value
	 */
	public void setIdSystemNull(boolean value)
	{
		this.idSystemNull = value;
	}

	/**
	 * Method 'isIdSystemNull'
	 * 
	 * @return boolean
	 */
	public boolean isIdSystemNull()
	{
		return idSystemNull;
	}

	/**
	 * Method 'equals'
	 * 
	 * @param _other
	 * @return boolean
	 */
	@Override
	public boolean equals(Object _other)
	{
		if (_other == null) {
			return false;
		}
		
		if (_other == this) {
			return true;
		}
		
		if (!(_other instanceof ModuleDTO)) {
			return false;
		}
		
		final ModuleDTO _cast = (ModuleDTO) _other;
		if (idModule != _cast.idModule) {
			return false;
		}
		
		if (description == null ? _cast.description != description : !description.equals( _cast.description )) {
			return false;
		}
		
		if (idSystem != _cast.idSystem) {
			return false;
		}
		
		if (idSystemNull != _cast.idSystemNull) {
			return false;
		}
		
		return true;
	}

	/**
	 * Method 'hashCode'
	 * 
	 * @return int
	 */
	@Override
	public int hashCode()
	{
		int _hashCode = 0;
		_hashCode = 29 * _hashCode + idModule;
		if (description != null) {
			_hashCode = 29 * _hashCode + description.hashCode();
		}
		
		_hashCode = 29 * _hashCode + idSystem;
		_hashCode = 29 * _hashCode + (idSystemNull ? 1 : 0);
		return _hashCode;
	}

	/**
	 * Method 'createPk'
	 * 
	 * @return ModulePk
	 */
	public ModulePkDTO createPk()
	{
		return new ModulePkDTO(idModule);
	}

	/**
	 * Method 'toString'
	 * 
	 * @return String
	 */
	@Override
	public String toString()
	{
		StringBuffer ret = new StringBuffer();
		ret.append( "com.sophossystems.client.asmon.dto.Module: " );
		ret.append( "idModule=" + idModule );
		ret.append( ", description=" + description );
		ret.append( ", idSystem=" + idSystem );
		return ret.toString();
	}

}
